<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>档案管理</title>
<link href="/static/css/layout.css" rel="stylesheet" type="text/css" />
<link href="/static/css/cb.css" rel="stylesheet" type="text/css" />
<link href="/static/css/n.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="/static/css/communcity.css"/> <#--comcn155 引用communcity样式-->
<link rel="stylesheet" type="text/css" href="/static/easyui/themes/default/easyui.css" />
<link rel="stylesheet" type="text/css" href="/static/easyui/themes/icon.css" />
<link rel="stylesheet" type="text/css" href="/static/easyui/demo/demo.css" />
<link rel="stylesheet" type="text/css" href="/static/js/laypage/skin/laypage.css" />

<script type="text/javascript" src="/static/easyui/jquery.min.js"></script>
<script src="/static/js/vue/vue.min.js" charset="utf-8"></script>
<script type="text/javascript" src="/static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="/static/js/laypage/laypage.js"></script>
<script type="text/javascript" src="/static/laydate/laydate.js"></script>
<script type="text/javascript" src="${request.contextPath}/static/easyui/locale/easyui-lang-zh_CN.js"></script> <#--comcn155 修改默认提示信息-->
<script type="text/javascript" src="${request.contextPath}/static/js/work-mange.js"></script> <#--comcn155 输入框输入提示信息-->


</head>
<body>
	<div id="app" style="width:1920px;height: 760px;overflow: scroll"><#--comcn155 添加滚动条-->
		<table width="99%" border="0" align="center" cellpadding="0"
			cellspacing="0">
			<tr>
				<td width="1%" align="left" background="/static/images/b2.jpg"><img
					src="/static/images/b1.jpg" width="10" height="26" /></td>
				<td width="68%" background="/static/images/b2.jpg"><table
						width="124" border="0" align="left" cellpadding="0"
						cellspacing="0">
						<tr>
							<td width="20" align="left"><img src="/static/images/tz.gif"
								width="10" height="16" /></td>
							<td width="104" align="left" class="biao">查找档案信息</td>
						</tr>
					</table></td>
				<td width="31%" align="right" background="/static/images/b2.jpg"><img
					src="/static/images/b3.jpg" width="9" height="26" /></td>
			</tr>
		</table>
		<table width="99%" border="0" align="center" cellpadding="3"
			cellspacing="1" bgcolor="#AEDEF4">
			<tr>
				<td align="center" bgcolor="#E2F7FE">
					<form id="form1" name="form1" method="post" action="">
						<table width="80%" border="0" cellspacing="1" cellpadding="3">
							<tr>
                                <td width="10%" align="right">身份证号:</td> <#--comcm155 添加身份证号查询事件-->
                                <td width="10%" align="left"><input type="text" id="papersnum" size="30" /></td>
								<td width="10%" align="right">姓名:</td>
								<td width="10%" align="left"><input type="text" id="name"
									size="15" /></td>
								<td width="10%" align="left"><input type="button"
									id="querycheck" value="查找" /></td>
								<td width="10%" colspan="2" align="right"><input
									type="button" onclick="addEvent()" name="" value="增加档案" /> </td>
							</tr>
						</table>
					</form>
				</td>
			</tr>
		</table>

		<table width="50%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td height="5"></td>
			</tr>
		</table>
		<table width="99%" border="0" align="center" cellpadding="0"
			cellspacing="0">
			<tr>
				<td width="1%" align="left" background="/static/images/b2.jpg"><img
					src="/static/images/b1.jpg" width="10" height="26" /></td>
				<td width="68%" background="/static/images/b2.jpg"><table
						width="124" border="0" align="left" cellpadding="0"
						cellspacing="0">
						<tr>
							<td width="20" align="left"><img src="/static/images/tz.gif"
								width="10" height="16" /></td>
							<td width="104" align="left" class="biao">档案列表</td>
						</tr>
					</table></td>
				<td width="31%" align="right" background="/static/images/b2.jpg"><img
					src="/static/images/b3.jpg" width="9" height="26" /></td>
			</tr>
		</table>
		<table width="99%" border="0" align="center" cellpadding="3"
			cellspacing="1" bgcolor="#AEDEF4" style="border: 1px solid #AEDEF4">
			<thead>
				<tr>
                    <td align="center" bgcolor="#EFFBFE">序号</td>
					<td align="center" bgcolor="#EFFBFE" style="width:66px; height: 38px;">姓名</td> <#--comcn155 调整页面姓名列宽度和高度-->
					<td align="center" bgcolor="#EFFBFE">身份证号</td>
					<td align="center" bgcolor="#EFFBFE">社区服刑人员日常谈话教育材料</td>
					<td align="center" bgcolor="#EFFBFE">社区服刑人员思想汇报情况登记表</td>
					<td align="center" bgcolor="#EFFBFE">社区服刑人员公益劳动情况登记表</td>
					<td align="center" bgcolor="#EFFBFE">社区服刑人员学习教育情况登记表</td>
					<td align="center" bgcolor="#EFFBFE">社区服刑人员外出请假申请审批表</td>
					<td align="center" bgcolor="#EFFBFE">社区服刑人员日常报到情况登记表</td>
					<td align="center" bgcolor="#EFFBFE">社区服刑人员月度小结、考核、评议、加(扣)分审批单及月度加(扣)分情况汇总表</td>
					<td align="center" bgcolor="#EFFBFE">社区服刑人员迁居审批表</td>
					<td align="center" bgcolor="#EFFBFE">法制(警示)教育和公益劳动等基地协议书</td>
					<td align="center" bgcolor="#EFFBFE">其他有短期保存价值的资料</td>
					<td align="center" bgcolor="#EFFBFE">管理操作</td>
				</tr>
			</thead>
			<tbody>
				<tr v-for="(item,index) in result"
					onmouseout="this.style.backgroundColor='#ffffff'" bgcolor="#ffffff"
					onmouseover="this.style.backgroundColor='#E6F2FF'">
                    <td style="width:50px;" align="center">{{index+1}}</td>
					<td align="center" class="t5">
					     <div align="center"><strong>{{item.name}}</strong></div></td>
                    <td style="width: 200px;" align="center">{{item.papersnum}}</td>
					<td align="center">{{item.tm1}}</td>
					<td align="center">{{item.tm2}}</td>
					<td align="center">{{item.tm3}}</td>
					<td align="center">{{item.tm4}}</td>
					<td align="center">{{item.tm5}}</td>
					<td align="center">{{item.tm6}}</td>
					<td align="center">{{item.tm7}}</td>
					<td align="center">{{item.tm8}}</td>
					<td align="center">{{item.tm9}}</td>
					<td align="center">{{item.tm10}}</td>

				<td align="left" width="100px" height="38px">
					<div align="left" style="padding-left: 5px">
						<div align="center">
							<input type="button" @click="checkEvent(item.id)" name="" value="查看" />
                            <input type="button" @click="editEvent(item.id)" name="" value="修改" />
							<input type="button" @click="delEvent(item.id)" name="" value="删除" />
						</div>
					</div>
				</td>
               </tr> 

				<tr>
					<td colspan="10" align="center">
						<div id="pagediv"></div>
					</td>
				</tr>
			</tbody>
		</table>
		<!-- 增加档案弹出框 -->
		<div id="dlg"></div>
		<!-- 查看档案弹出框 -->
		<div id="dlg1"></div>
		<div id="editDlg"></div> <#--comcn155 查看档案弹出框-->
	</div>

	<!-- js代码控制增删改查弹出层 -->
	<script>
		var app = new Vue({
			el : '#app',
			data : {
				result : []
			}
		});
		//模糊查询分页列表
		var getPageList = function(curr) {
			$.ajax({
				type : "get",
				dataType : "json",
				url : "/cAdmin/get",
				data : {
					pageNum : curr || 1,
					pageSize : 15,
					name : $("#name").val(),
					papersnum : $("#papersnum").val()
				},
				
				//显示分页
				success : function(msg) {
					app.result = msg.data[0].result;
					laypage({
						cont : 'pagediv', //容器。值支持id名、原生dom对象，jquery对象,
						pages : msg.data[0].totalPage, //总页数
						first : "首页",
						last : "尾页",
						skip : true, //是否开启跳页
						skin : '#5675A2',
						curr : curr || 1, //当前页
						jump : function(obj, first) { //触发分页后的回调
							if (!first) { //点击跳页触发函数自身，并传递当前页：obj.curr
								getPageList(obj.curr);
							}
						}
					});
				}
			});
		}
		//获取档案记录列表
		getPageList();

		//模糊查询档案记录
		$('#querycheck').on('click', function() {
			getPageList();
		});
		//增加档案记录
		
		var addEvent = function() {
			$('#dlg').dialog({
				title : '增加---档案',
				width : 920, /*comcn155 调整对话框长度和宽度*/
				height : 550,
                left: 400,
                top: 150,
				closed : false,
				cache : false,
                minimizable:true, 
                maximizable:true, 
                resizable:true, 
				href : '/cAdmin/add',
				modal : true,
				buttons : [ {
					text : '保存',
					iconCls : 'icon-ok',
					handler : function() {
					    if($("#form2").form('validate')){ /*comcn155 jquery表单验证*/
						$.ajax({
							url : "/cAdmin/upload",
							type : "post",
							contentType: false,  
					        processData: false, 
							async: true, /*comcn155 请求为异步数据，若为同步数据，页面调试出现警告*/
					        cache: false,
							data : new FormData($("#form2")[0]),
							success : function(result) {
								$.messager.alert({
									title : '消息',
									msg : '保存成功!',
									icon : 'info'
								});
								getPageList();
								$('#dlg').dialog('close');
							}
						});
					    }
                    }
				}, {
					text : '关闭',
					handler : function() {
						$('#dlg').dialog('close');
					}
				}]
			});
		}

		var editEvent = function (id) { /*comcn155 添加修改档案点击事件*/
			$('#editDlg').dialog({
                title : '修改---档案',
                width : 920,
                height : 550,
                left: 400,
                top: 150,
                closed : false,
                cache : false,
                minimizable:true,
                maximizable:true,
                resizable:true,
                href : '/cAdmin/getId?sort=edit&id='+id,
                modal : true,
                buttons : [ {
                    text : '保存',
                    iconCls : 'icon-ok',
                    handler : function() {
                        if($("#editForm").form('validate')){
                            $.ajax({
                                url : "/cAdmin/uploadEdit",
                                type : "post",
                                contentType: false,
                                processData: false,
                                async: true,
                                cache: false,
                                data : new FormData($("#editForm")[0]),
                                success : function(result) {
                                    $.messager.alert({
                                        title : '消息',
                                        msg : '修改成功!',
                                        icon : 'info'
                                    });
                                    getPageList();
                                    $('#editDlg').dialog('close');
                                }
                            });
                        }
                    }
                }, {
                    text : '关闭',
                    handler : function() {
                        $('#editDlg').dialog('close');
                    }
                }]
			})
        }

		//查看档案详情
		var checkEvent = function(id) {
			$('#dlg1').dialog({
				title : '查看---档案详情',
				width : 720,
				height : 400,
                left: 500,
                top: 150,
				closed : false,
				cache : false,
				minimizable:true, /*comcn155 最小化按钮*/
				maximizable:true, /*最大化按钮*/
				resizable:true, /*是否可折叠*/
				href : '/cAdmin/getId?id=' + id,
				modal : true,
				buttons : [ {
					text : '关闭',
					handler : function() {
						$('#dlg1').dialog('close');
					}
				} ]
			});
		}

		//删除档案
		var delEvent = function(id) {
			$.messager.confirm('提示框', '你确定要删除吗?', function(res) {
				if (res) {
					$.ajax({
						url : "/cAdmin/del",
						type : "post",
						dataType : "json",
						data : {
							id : id
						},
						success : function(result) {
							$.messager.alert({
								title : '消息',
								msg : '删除成功!',
								icon : 'info'
							});
							getPageList();
						}
					});
				} else {
					//取消删除
				}
			})
		}
	</script>


</body>
</html>